package com.zto.sch.base.normal;

/**
 * @program: sch-diy-parent
 * @description:
 * @author: sch
 * @create: 2020-12-11 20:53
 **/
public class 可变参数 {
    /**
     * redis 查询memberId前缀
     */
    public static final String MEMBERID_REDIS_PREFIX = "memberUserRelation:%s:%s:%s";

    /**
     * redis 查询memberdata前缀
     */
    public static final String MEMBERDATA_REDIS_PREFIX = "memberData:%s";

    public static String getKey(String prefix, String... data) {
        return String.format(prefix, data);
    }

    public static void main(String[] args) {
        String key = getKey(MEMBERID_REDIS_PREFIX, "哈哈", "呵呵", "厉害了");
        System.out.println("---------------" + key);

        String key2 = getKey(MEMBERDATA_REDIS_PREFIX, "哈哈");
        System.out.println("=============" + key2);

    }
}
